import QtQuick 2.15
import QtQuick.Controls 2.15

ApplicationWindow {
    height: 480
    title: qsTr("Image Display")
    visible: true
    width: 640

    Image {
        id: root

        anchors.fill: parent
        source: "https://img2.baidu.com/it/u=2551797484,2359774049&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=281"

        Image {
            id: pole

            anchors.bottom: parent.bottom
            anchors.horizontalCenter: parent.horizontalCenter
            height: 250
            source: '/resources/img/pole.png'
        }
        Image {
            id: wheel

            anchors.centerIn: parent
            source: '/resources/img/wheel.png'

            Behavior on rotation {
                NumberAnimation {
                    duration: 200
                }
            }
        }
        MouseArea {
            anchors.fill: parent

            onClicked: wheel.rotation += 180
        }
    }
}
